package com.windward.vii.service;

import com.alibaba.fastjson.JSONObject;
import com.windward.vii.common.JsonResult;
import com.windward.vii.dao.entity.AppFunction;
import com.windward.vii.dao.mapper.AppFunctionMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by tiansj on 2017/9/28.
 */
@Component
public class AppFunctionService {

    @Resource
    AppFunctionMapper appFunctionMapper;

    public JsonResult checkIsShowWithdraw(String uri) {
        AppFunction appFunction = appFunctionMapper.selectByUri(2, uri);
        JSONObject object = new JSONObject();
        if(appFunction != null && appFunction.getEnable()) {
            object.put("visible", true);
        } else {
            object.put("visible", false);
        }
        JsonResult jsonResult = JsonResult.success();
        jsonResult.setBody(object);
        return jsonResult;
    }

}
